package com.bush.mall.order.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.order.entity.RefundInfoEntity;
import com.bush.mall.order.service.RefundInfoService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 退款信息
 * @author RUN
 * @date 2022-11-29
 */
@RestController
@RequestMapping("refundinfo")
@Api(tags = "退款信息管理" )
public class RefundInfoController {

    @Resource(name= RefundInfoService.BEAN_ID)
    private RefundInfoService refundInfoService;

    /**
     * 分页查询退款信息列表
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "分页查询退款信息列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return refundInfoService.queryForPage(current,size);
    }

    /**
     * 保存退款信息表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "保存退款信息表单")
    @PostMapping
    public Result saveRefundInfo(@RequestBody RefundInfoEntity refundInfo){
        return refundInfoService.saveRefundInfo(refundInfo);
    }

    /**
     * 修改退款信息表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "修改退款信息表单")
    @PutMapping
    public Result updateRefundInfo(@RequestBody RefundInfoEntity refundInfo){
        return refundInfoService.updateRefundInfo(refundInfo);
    }

    /**
     * 通过指定id删除退款信息
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "通过指定id删除退款信息")
    @DeleteMapping
    public Result deleteRefundInfo(Long id){
        return refundInfoService.deleteRefundInfo(id);
    }

}
